package com.cks;

import com.cks.util.GameUtils;

import java.awt.*;

import static com.cks.util.GameUtils.*;

/*
* 绘制底层底图图
* 绘制游戏相关组件*/
public class MapBottom {

     void paintSelf(Graphics g){
         g.setColor(Color.red);
         //画竖线
         for(int i = 0; i<=GameUtils.MAP_W; i++){
             g.drawLine(OFFSET+i*SQUARE_LENGTH,
                     3* OFFSET,
                     OFFSET+i*SQUARE_LENGTH,
                     3*OFFSET+ MAP_H*SQUARE_LENGTH);
         }

         //画横线
         for(int i = 0; i<=GameUtils.MAP_H; i++){
             g.drawLine(OFFSET,
                     3* OFFSET+i*SQUARE_LENGTH,
                     OFFSET+MAP_W*SQUARE_LENGTH,
                     3*OFFSET+ i*SQUARE_LENGTH);
         }
     }
}
